//
//  XGDataManager.h
//  BSBuDeJie
//
//  Created by monkey on 2018/12/11.
//  Copyright © 2018 itcast. All rights reserved.
//

#import <Foundation/Foundation.h>

@class XGAdvertisementModel;
@class XGNewsRecommendTagModel;
@class XGSquareModel;
@class XGTopicModel;
@class XGCategoryModel;
@class XGCategoryRecommendTagModel;

typedef NS_ENUM(NSUInteger, XGTopicType) {
    XGTopicTypeAll = 1, // 全部
    XGTopicTypePicture = 10,    // 图片
    XGTopicTypeWord = 29,   // 段子
    XGTopicTypeVoice = 31,  // 声音
    XGTopicTypeVideo = 41,  // 视频
};

NS_ASSUME_NONNULL_BEGIN

@interface XGDataManager : NSObject

/**
 加载广告页面数据

 @param completion 完成回调
 */
+ (void)loadAdvertisement:(void (^)(XGAdvertisementModel *_Nullable advertisementModel, NSError *_Nullable error))completion;

/**
 加载推荐列表

 @param completion 完成回调
 */
+ (void)loadRecommendList:(void (^)(NSArray<XGNewsRecommendTagModel *> *_Nullable dataArray, NSError *_Nullable error))completion;

/**
 加载辅助功能列表

 @param completion 完成回调
 */
+ (void)loadSquareList:(void (^)(NSArray<XGSquareModel *> *_Nullable dataArray, NSError *_Nullable error))completion;

/**
 加载帖子

 @param type 帖子类型
 @param maxTime 最大帖子ID 用来加载更多数据 如不需要传0
 @param minTime 最小帖子ID  用来加载最新数据 如不需要传0
 @param completion 完成回调
 */
+ (void)loadTopicWithType:(XGTopicType)type maxTime:(NSInteger)maxTime minTime:(NSInteger)minTime completion:(void (^)(NSArray<XGTopicModel *> *_Nullable dataArray, NSError *_Nullable error))completion;


/**
 加载推荐关注分类

 @param completion 完成回调
 */
+ (void)loadCategoryList:(void (^)(NSArray<XGCategoryModel *> *_Nullable dataArray, NSError *_Nullable error))completion;

/**
  加载推荐关注分类下的标签

 @param ID 分类id
 @param page 页码
 @param completion 完成回调
 */
+ (void)loadCategoryTagListWithID:(NSInteger)ID page:(NSInteger)page completion:(void (^)(NSArray<XGCategoryRecommendTagModel *> *_Nullable dataArray,NSInteger total,NSError *_Nullable error))completion;

/**
 取消网络请求
 */
+ (void)cancelRequest;

@end

NS_ASSUME_NONNULL_END
